package com.csw.compose.ui.components

import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp

/**
 * 间隔尺寸
 * @param value 尺寸大小(Dp)
 */
enum class SpacerType(val value:Dp) {
    MINI(4.dp),
    NORMAL(8.dp),
    LARGER(16.dp),
}

@Composable
fun SpacerWithSize(size:Dp = SpacerType.NORMAL.value){
    Spacer(modifier = Modifier.size(size))
}

/**
 * 预览使用的列表间隔
 */
@Composable
fun PreviewSpacer(){
    SpacerWithSize()
}

@Composable
fun MiniSpacer(){
    SpacerWithSize(SpacerType.MINI.value)
}

@Composable
fun NormalSpacer(){
    SpacerWithSize(SpacerType.NORMAL.value)
}

@Composable
fun LargeSpacer(){
    SpacerWithSize(SpacerType.LARGER.value)
}
